public class Main {


    public static void main(String[] args) {



    }
    public static void main3(String[] args) {
        //测试单链表实现的栈
        MyStackList list = new MyStackList();
        list.push(1);

        System.out.println(list.pop());
        list.push(2);
        System.out.println(list.pop());
        list.push(3);
        list.push(4);
        list.push(5);
        System.out.println(list.peek());
        System.out.println(list.size());
        System.out.println(list.empty());
    }

    public static void main2(String[] args) {
        //数组栈
        MyStack stack = new MyStack();
        stack.push(1);
        System.out.println(stack.pop());
        stack.push(2);
        stack.push(3);
        System.out.println(stack.pop());
        stack.push(4);
        stack.push(5);
        System.out.println(stack.size());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());



    }
    public static void main1(String[] args) {
        MyStack stack = new MyStack();
        stack.push(1);
        stack.push(2);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        System.out.println(stack.peek());

        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.peek());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println("--------------");
        System.out.println(stack.pop());
    }

}
